package com.bbva.kyfb.kyfbdtofo;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.springframework.stereotype.Component;

@Component
public class BuzonItem {

	private int canal;
	private int bancoInterno;
	private String logon;
	private String numItem;
	private Character xtibuzon;
	private String fecha;
	private String hora;
	private int codPid;
	
	public static List<BuzonItem> parseRegBuzon(List<Object[]> listaRegBuzon) {
		
		final ArrayList<BuzonItem> listaRegBuzonDto = new ArrayList<BuzonItem>();
		
		BuzonItem listaRegBuz;
		
		int i;
		for(Object[] o : listaRegBuzon)
		{
			i = 0;
			listaRegBuz = new BuzonItem();
			listaRegBuz.setCanal(Integer.parseInt((String)o[i]));
			listaRegBuz.setBancoInterno((Short)o[++i]);
			listaRegBuz.setLogon((String)o[++i]);
			listaRegBuz.setXtibuzon((Character)o[++i]);
			listaRegBuz.setNumItem((String)o[++i]);
			listaRegBuz.setFecha((String)o[++i]);
			listaRegBuz.setHora((String)o[++i]);
			listaRegBuz.setCodPid(Integer.parseInt((String)o[++i]));
			listaRegBuzonDto.add(listaRegBuz);
		}
		
		return listaRegBuzonDto;
	}
	
	public int getCanal() {
		return canal;
	}
	public void setCanal(int canal) {
		this.canal = canal;
	}
	public int getBancoInterno() {
		return bancoInterno;
	}
	public void setBancoInterno(int bancoInterno) {
		this.bancoInterno = bancoInterno;
	}
	public String getLogon() {
		return logon;
	}
	public void setLogon(String logon) {
		this.logon = logon;
	}
	public String getNumItem() {
		return numItem;
	}
	public void setNumItem(String numItem) {
		this.numItem = numItem;
	}
	public Character getXtibuzon() {
		return xtibuzon;
	}
	public void setXtibuzon(Character xtibuzon) {
		this.xtibuzon = xtibuzon;
	}
	public String getFecha() {
		return fecha;
	}
	public void setFecha(String fecha) {
		this.fecha = fecha;
	}
	public String getHora() {
		return hora;
	}
	public void setHora(String hora) {
		this.hora = hora;
	}
	public int getCodPid() {
		return codPid;
	}
	public void setCodPid(int codPid) {
		this.codPid = codPid;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}